 /*
  *@(#)RequestCtl.java		6 Sept. 2000
  *
  * Copyright: MetaPlus Inc & Inquiry Management Systems Ltd.  2000
  *
  * This software is the proprietary information of MetaPlus Inc & 
  * Inquiry Management Systems Ltd.  
  * Use is subject to license terms.
  */
package com.ims.iaa;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
  * The remote interface for the Request Control Center which centrally control 
  * <code>AdTrackRequest</code> remote objects. The center provides 
  * services such as accomdate request object, add /remove request, query 
  * request processing state, dispatch request to Spider Control Center.
  *
  * @see RequestCtlImpl
  *
  * @author Anthony Zhang
  *
  * @version 1.00, 25 Sept. 2000
  *
  */
public interface RequestCtl extends Remote {
  
  /** 
    *  Adds an ad track request to the Request Control Center
    *
    *  @param localRequest The <code>LocalRequest</code> object ( which 
	*   represent the data model of the ad track request ) needed to be add
	*  into the Center.
	*
	*  @return Indicate whether adds successfully or not
	*
    *  @see RequestCtlImpl#addAdTrackRequest
    */
  public boolean addAdTrackRequest(LocalRequest localRequest)
        throws RemoteException;

  /** 
    *  Removes an ad track request from the Request Control Center
    *
    *  @param adTrackRequest The ad track request which should be removed.
	*
    *  @return Indicate whether remove successfully or not
	*
	*  @see RequestCtlImpl#removeAdTrackRequest
    */
  public boolean removeAdTrackRequest(AdTrackRequest adTrackRequest)
        throws RemoteException;
  /** 
    * Notify the Center to start dispatching requests. 
	*
    * @return void
	*
	* @see RequestCtlImpl#raiseDispatchEvent
	*/	
  public void raiseDispatchEvent()	
        throws RemoteException;

  /** 
    * Inquiry the Center about requests which are in the specified state
	* 
	* @param state State of requests. Can be constant WAITING,PROCESSING,
	*	PROCESSED of <code>AdTrackRequest</code> interface.
    *
    * @return Array of request object 
    *
    * @see RequestCtlImpl#inquiryRequest
    */	
  public Object [] inquiryRequest(byte state)	
        throws RemoteException;
  /**
    * Inform the Center that a specific request has finished.
	*
	* @param adTrackRequest The ad track request which has finished.
	*
	* @return void
	*
	* @see RequestCtlImpl#finishAdRequest
	*/		
  public void finishAdRequest(AdTrackRequest adTrackRequest)	
        throws RemoteException;		
}
        